class Car(object):
    def __init__(self, brand, model, color):
        self.brand = brand
        self.model = model
        self.color = color
    def run(self):
        print('i can run')
    def refueling(self):
        print(self.brand," is refueling")
class GasolineCar(Car):
    def __init__(self, brand, model, color):
        super().__init__(brand, model, color)
        # self.brand = brand
        # self.model = model
        # self.color = color
    def run(self):
        super().run()
        print('i can run with gas',self.brand)
class ElectricCar(Car):
    def __init__(self, brand, model, color,battery):
        super().__init__(brand, model, color)
        # 代表电池电量。
        self.battery = battery
    def run(self):
        print('i can run whith electric,remind',self.battery)
bmw = GasolineCar('宝马', 'x5', '白色')
bmw.run()
bmw.refueling()
# tesla.refueling()

tesla = ElectricCar('特斯拉', 'model3', '红色',100)
tesla.run()
tesla.refueling()
Car.refueling(tesla) #本质
Car.refueling(bmw) #本质


